Respiration induced organ motion during radiotherapy treatment delivery limits the capability for dose escalation and/or normal tissue sparing. The goal of this application is to improve the clinical outcome of radiotherapy for thoracic and abdominal tumors where respiratory motion is often an issue, by improving the precision of tumor localization during the treatment. This goal can be reached through the development of a well-engineered real-time tumor tracking system based an on-board x-ray imaging system that is currently being built by Massachusetts General Hospital (MGH) and Varian Medical Systems, Inc. (VMS). In the proposed project, through an expanded collaboration between MGH and VMS, we plan to develop a software framework and key function algorithms for the tracking system. The software framework will be developed by VMS by incorporating MGH's clinical perspectives, based on the framework of RPM Respiratory Gating System, a commercial product from VMS. Algorithms for the key functional blocks will be developed and tested mainly by MGH with technical assistance from VMS, using the software framework and the hardware platform as a test bed. he software framework and modules will be validated on the hardware platform using a computer-controlled dynamic phantom. The software system, combined with the hardware platform, will facilitate real-time tumor tracking with high precision and robustness. The system will be used for clinical trials to treat mobile tumors at MGH and can potentially be commercialized by VMS. The proposed project will greatly strengthen the relationship between MGH and VMS, leading to enhanced collaborative research activities as well as future research projects in the area of image guided radiotherapy.